// 匿名函数
(async function() {
	var params = getJsParams('macro_mobile_ctl');
    var fieldName = params.fieldName;
    var formCode = params.formCode;
    
    $(fo(fieldName)).change(function() {
        var obj = this;
        if ($(this).val=="") {
            return;
        }
    
        var ajaxData = {
            fieldName: fieldName,
            formCode: formCode,
            val: $(this).val()
        };
        ajaxPost('/module_check/checkMobile', ajaxData).then((data) => {
            console.log('data', data);
            if (data.ret==0) {
                $('#errMsgBox_' + fieldName).remove();
                $(obj).parent().append("<span id='errMsgBox_" + fieldName + "' class='LV_validation_message LV_invalid'>" + data.msg + "</span>");
            }
            else {
                $('#errMsgBox_' + fieldName).remove();
            }
        });
    })     
})();
